package cn.stylefeng.guns.modular.storage.mapper;

import cn.stylefeng.guns.modular.rest.storagePut.tarpanBatch;
import cn.stylefeng.guns.modular.storage.entity.StoragePutSingle;
import cn.stylefeng.guns.modular.storage.model.params.StoragePutSingleParam;
import cn.stylefeng.guns.modular.storage.model.result.StoragePutSingleResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 入库单明细表 Mapper 接口
 * </p>
 *
 * @author zhucx
 * @since 2019-07-08
 */
public interface StoragePutSingleMapper extends BaseMapper<StoragePutSingle> {

    /**
     * 获取列表
     *
     * @author zhucx
     * @Date 2019-07-08
     */
    List<StoragePutSingleResult> customList(@Param("paramCondition") StoragePutSingleParam paramCondition);

	/**
	 * 获取列表
	 *
	 * @author zhucx
	 * @Date 2019-07-08
	 */
	List<StoragePutSingleResult> TcustomList(@Param("paramCondition") StoragePutSingleParam paramCondition);


    /**
     * 获取map列表
     *
     * @author zhucx
     * @Date 2019-07-08
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") StoragePutSingleParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zhucx
     * @Date 2019-07-08
     */
    Page<StoragePutSingleResult> customPageList(@Param("page") Page page, @Param("paramCondition") StoragePutSingleParam paramCondition, @Param("condition") String condition);

    /**
     * 获取分页map列表
     *
     * @author zhucx
     * @Date 2019-07-08
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") StoragePutSingleParam paramCondition);

	StoragePutSingle findByThelastone();

	Page<StoragePutSingleResult> findPageDISTINCTGoods(@Param("page")Page pageContext, @Param("paramCondition")StoragePutSingleParam storagePutSingleParam);

	Page<StoragePutSingleResult> findPageworkGoods(@Param("page")Page pageContext, @Param("paramCondition")StoragePutSingleParam storagePutSingleParam);

	List<StoragePutSingleResult> findListBySpec(@Param("paramCondition")StoragePutSingleParam storagePutSingleParam);

	boolean saveBatchList(@Param("list")List<StoragePutSingle> list);

	Page<StoragePutSingleResult> findPageDISTINCTbatch(@Param("page")Page pageContext, @Param("paramCondition")StoragePutSingleParam storagePutSingleParam);

	List<StoragePutSingleResult> finByOnlyOne(@Param("paramCondition") StoragePutSingleParam sp);

    boolean updateBatchList(@Param("splist")List<StoragePutSingle> splist);

	boolean batchDelete(@Param("plist")List<Integer> pList);

	StoragePutSingleResult findBySpecL1(@Param("paramCondition") StoragePutSingleParam storagePutSingleParam);

	boolean updateBatchListState(@Param("splist")List<StoragePutSingle> list);

	List<StoragePutSingleResult> findpositionlist(@Param("paramCondition") StoragePutSingleParam storagePutSingleParam);

	List<StoragePutSingleResult> confirmpositionGoodslist(@Param("paramCondition")StoragePutSingleParam storagePutSingleParam);

	List<StoragePutSingleResult> checkPositionGoodsNum(@Param("paramCondition")StoragePutSingleParam param);

	int findTrayListRecommend(@Param("paramCondition")StoragePutSingleParam param);

	StoragePutSingleResult findBySpec(@Param("paramCondition")StoragePutSingleParam param);

    List<StoragePutSingleResult> totalListByGandPSpec(@Param("paramCondition")StoragePutSingleParam putDetailedParam);

	List<StoragePutSingleResult> totalListBySpec(@Param("paramCondition")StoragePutSingleParam putDetailedParam);

	void updateBatchListPosition(@Param("list")List<StoragePutSingleResult> list);

	List<StoragePutSingleResult> referPosition(@Param("paramCondition")StoragePutSingleParam putDetailedParam);

	StoragePutSingleResult findBywarehouseIdSpec(@Param("paramCondition")StoragePutSingleParam param, @Param("warehouseId")Long warehouseId);

	List<StoragePutSingleResult> findPageDISTINCTGoodsNew(@Param("paramCondition")StoragePutSingleParam param);

	List<StoragePutSingleResult> findPageDISTINCTbatchNew(@Param("paramCondition")StoragePutSingleParam param);

	List<tarpanBatch> customListNew(@Param("paramCondition")StoragePutSingleParam param);

	List<tarpanBatch> TcustomListNew(@Param("paramCondition")StoragePutSingleParam param);

	List<tarpanBatch> confirmpositionGoodslistNew(@Param("paramCondition")StoragePutSingleParam param);

	StoragePutSingleResult monthPutCount(@Param("paramCondition")StoragePutSingleParam param, @Param("warehouseId")Long warehouseId);

	Page<StoragePutSingleResult> findPageBySpecjilu(@Param("page")Page pageContext, @Param("paramCondition")StoragePutSingleParam param, @Param("condition")String condition, @Param("warehouseId")Long warehouseId,
			@Param("deptId")Long deptId, @Param("deliverId")Long deliverId,@Param("operateId")Long operateId);

	List<StoragePutSingleResult> findListBySpecNew(@Param("paramCondition")StoragePutSingleParam param);

	List<StoragePutSingleResult> findListBySpecGroupByGoodsid(@Param("paramCondition")StoragePutSingleParam param);

	StoragePutSingleResult sumPutByDay(@Param("paramCondition")StoragePutSingleParam putSingleParam,@Param("customerId")Long customerId, @Param("warehouseId")Long warehouseId);

	List<StoragePutSingleResult> findExportToExcelBySpec(@Param("paramCondition")StoragePutSingleParam param, @Param("operateId")Long operateId);
}
